module MethodicalDomID
 def method_missing(meth, *args)
   if meth.to_s =~ /^id_(.+)?$/
     ident = new_record? ? "new" : "id_#{id}"
     [self.class.name.underscore, $1, ident, args.first].compact.join('_')
   else
     super
   end
 end
end
ActiveRecord::Base.send(:include, MethodicalDomID)
